68 |
' ' ' ***** GetSmallestSize ***** ' SUB GetSmallestSize XuiSendMessage (grid, #GetBorder, 0, 0, 0, 0, $XuiDialog2B, @bw) XuiSendMessage (grid, #GetSmallestSize, 0, 0, @labelWidth, @labelHeight, $Label, 8) XuiSendMessage (grid, #GetSmallestSize, 0, 0, @textWidth, @textHeight, $TextLine, 8) ' FOR i = $Button0 TO $Button1 XuiSendMessage (grid, #GetSmallestSize, 0, 0, @width, @height, i, 8) IF (width > buttonWidth) THEN buttonWidth = width IF (height > buttonHeight) THEN buttonHeight = heigh NEXT i ' width = buttonWidth + buttonWidth IF (width < labelWidth) THEN width = labelWidth v2 = width + bw + bw v3 = labelHeight + buttonHeight + textHeight + bw + bw END SUB ' ' ' ***** Resize ***** ' SUB Resize vv2 = v2 vv3 = v3 GOSUB GetSmallestSize ' returns bw and heights v2 = MAX (vv2, v2) v3 = MAX (vv3, v3) ' XuiPositionGrid (grid, @v0, @v1, @v2, @v3) ' h = labelHeight + buttonHeight + textHeight + bw + bw IF (v3 >= h + 4) THEN buttonHeight = buttonHeight + 4 : h = h + 4 IF (v3 >= h + 4) THEN textHeight = textHeight + 4 END IF ' labelWidth = v2 - bw - bw labelHeight = v3 - buttonHeight - textHeight - bw - bw buttonWidth = labelWidth >> 1 w0 = buttonWidth w1 = labelWidth - w0 ' x = v0 + bw y = v1 + bw w = labelWidth XuiSendMessage (grid, #Resize, x, y, w, labelHeight, $Label, 0) ' y = y + labelHeight XuiSendMessage (grid, #Resize, x, y, w, textHeight, $TextLine, 0) ' h = buttonHeight y = y + textHeight XuiSendMessage (grid, #Resize, x, y, w0, h, $Button0, 0) : x = x + w0 XuiSendMessage (grid, #Resize, x, y, w1, h, $Button1, 0) : x = x + w1 XuiResizeWindowToGrid (grid, #ResizeWindowToGrid, v0, v1, v2, v3, 0, 0) END SUB ' ' ' ***** Selection ***** ' SUB Selection SELECT CASE r0 CASE $XuiDialog2B : CASE $TextLine : CASE $Button0 : CASE $Button1 : END SELECT END SUB |